package com.devunion.bogdan.spring;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.access.BeanFactoryLocator;
import org.springframework.beans.factory.access.SingletonBeanFactoryLocator;
import org.springframework.beans.factory.access.BeanFactoryReference;

/**
 * @author Victar Liaskovich
 */
public class Context {
    private static BeanFactory context;

    static {
        BeanFactoryLocator bfl = SingletonBeanFactoryLocator.getInstance();
        BeanFactoryReference bf = bfl.useBeanFactory("com.devunion.bogdan");
        context = bf.getFactory();
    }

    public static BeanFactory getContext() {
        return context;
    }
}
